{extend name="public/base"}

{block name="x-body"}
<style>
    .layui-table {
        margin-top: 25px;
    }

    .layui-table th, td  {
        text-align: center;
    }

    .title {
        margin-bottom: 8px;
    }

    .title span:first-of-type {
        font-size: 16px;
        font-weight: bold;
    }

    .title span:last-of-type {
        font-size: 12px;
    }
</style>
<div class="x-body">
    <div class="layui-row">
    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加运费模板','{:url(\'MallConfig/freightTemplate_form\')}')"><i class="layui-icon"></i>添加</button>
        <span class="x-right" style="line-height:40px">共有数据：{$list -> total()} 条</span>
    </xblock>

    {volist name="list" id="v"}
        <table class="layui-table layui-form">
            <caption class="title">
                <span>{$v.name}</span>
                <span>{if $v.type == 0}件数{elseif $v.type == 1}重量{elseif $v.type == 2}体积{/if}</span>
                <a title="编辑"  onclick="x_admin_show('编辑运费模板', '{:url(\'MallConfig/freightTemplate_form\', [\'id\' => $v.id])}')" href="javascript:;">
                    <i class="layui-icon">&#xe642;</i>
                </a>
                <a title="删除" onclick="member_del(this,'{$v.id}', '{:url(\'MallConfig/freightTemplate_del\')}', function (){window.location.reload();})" href="javascript:;">
                    <i class="layui-icon">&#xe640;</i>
                </a>
            </caption>
            <thead>
                <tr>
                    <th>配送区域</th>
                    <th>首件数({if $v.type == 0}件{elseif $v.type == 1}克{elseif $v.type == 2}立方米{/if})</th>
                    <th>运费(元)</th>
                    <th>续件数({if $v.type == 0}件{elseif $v.type == 1}克{elseif $v.type == 2}立方米{/if})</th>
                    <th>运费(元)</th>
                </tr>
            </thead>
            <tbody>
                {volist name="v.config" id="val"}
                    <tr>
                        <td>{$val.region}</td>
                        <td>{$val.first_unit}</td>
                        <td>{$val.first_money}</td>
                        <td>{$val.continue_unit}</td>
                        <td>{$val.continue_money}</td>
                    </tr>
                {/volist}
            </tbody>
        </table>
    {/volist}

    <div class="page">
        <div>
            {$list -> render()|raw}
        </div>
    </div>
</div>

<script>

</script>
{/block}